<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Step 2: Enabling the Automatic Backup Function of zkmeta">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="en-us_topic_0000001839290513.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
<meta name="DC.Publisher" content="20240608">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001792571132">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Step 2: Enabling the Automatic Backup Function of zkmeta</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001792571132"></a><a name="EN-US_TOPIC_0000001792571132"></a>

<h1 class="topictitle1">Step 2: Enabling the Automatic Backup Function of zkmeta</h1>
<div><p>Before performing a TDSQL backup job, you need to enable the automatic backup function of zkmeta. Otherwise, cross-cluster database restoration will fail.</p>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li><span>Log in to a schedule node as user <strong>root</strong>.</span></li><li><span>Run the following command to modify configuration file <span class="filepath"><b>confscheduler.xml</b></span>:</span><p><p><strong>cd /data/application/scheduler/conf/</strong></p>
<p><strong>vi scheduler.xml</strong></p>
<p>Add the following information to the configuration file:</p>
<pre class="screen">&lt;back_zkmeta value="on"/&gt;</pre>
</p></li><li><span>Log in to a ZooKeeper node as user <strong>root</strong>.</span><p><p><strong>cd /data/application/zookeeper/bin/</strong></p>
<p><strong>./zkCli.sh -server 127.0.0.1:</strong><em>Port number</em></p>
<p>Example:</p>
<pre class="screen">cd /data/application/zookeeper/bin/
./zkCli.sh -server 127.0.0.1:2118</pre>
<div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p>Replace the port number in the command with the actual ZooKeeper port number queried on the TDSQL CHITU management console.</p>
</div></div>
</p></li><li><span>Run the following commands to modify the configuration:</span><p><ol type="a"><li>Run the following command to query the configuration item content:<p><strong>get /tdsqlzk/configs/agent@global</strong></p>
<p>The following is an example of the query result:</p>
<pre class="screen">{"generate_es_conf":"0","oc_dir":"/data/oc_agent","ocagent_port":"8966"}</pre>
</li><li id="EN-US_TOPIC_0000001792571132__li176434913571"><a name="EN-US_TOPIC_0000001792571132__li176434913571"></a><a name="li176434913571"></a>Add the following content to the returned JSON result:<pre class="screen">"local_backup":"1"</pre>
<p>The following is an example of the added result:</p>
<pre class="screen">{"generate_es_conf":"0","oc_dir":"/data/oc_agent","ocagent_port":"8966","local_backup":"1"}</pre>
</li><li>Run the following command to set the result added in <a href="#EN-US_TOPIC_0000001792571132__li176434913571">4.b</a> to the configuration item:<p><strong>set /tdsqlzk/configs/agent@global </strong><em>{"generate_es_conf":"0","oc_dir":"/data/oc_agent","ocagent_port":"8966","local_backup":"1"}</em></p>
<div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p>Replace <em>{"generate_es_conf":"0","oc_dir":"/data/oc_agent","ocagent_port":"8966","local_backup":"1"}</em> in the preceding command with the actual one.</p>
</div></div>
</li></ol>
</p></li><li><span>Log in to all nodes where the cluster is located as user <strong>root</strong> and run the <strong>reboot</strong> command to restart the production host.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001839290513.html">Backing Up TDSQL Databases</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>